<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        #box {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            background-color: pink;
            position: absolute;
            text-align: center;
            line-height: 100px;
            top: 10px;
            left: 0;
            /* 鼠标效果显示无 */
            cursor: none;
        }
    </style>
</head>

<body>
    <div id="box">+</div>
    <script>
        var box = document.querySelector("#box");
        var e = event || window.event;
        // 给整个网页添加事件源
        document.addEventListener('mousemove', function (e) {
            var x = e.clientX - 50;
            var y = e.clientY - 50;
            box.style.top = y + 'px';
            box.style.left = x + 'px';
            console.log(e.clientX);
            console.log(e.clientY);
        })
    </script>
</body>

</html>